﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PS.Engine.GameComponents;

namespace PS.Engine.Strategies
{
    internal class GentlemanWaitStrategy : WaitStrategy
    {
        // The pedestrian with the smaller BoorFactor (weniger Rüpel) has to wait
        internal override bool Wait(Pedestrian currentPedestrian, Pedestrian collisionar)
        {
            bool wait = (currentPedestrian.GetBoorFactor() <= collisionar.GetBoorFactor());

            // If the boor is at the goal the current pedestrian can walk anyway
            if (wait)
            {
                wait = !collisionar.AtGoal;
            }

            return wait;
        }

        // Indicates the precedence of this strategy
        internal override int Precedence
        {
            get { return 6; }
        }
    }
}
